package com.abstractfactory;

/**
 * @author sailor wang
 * @date 2018/8/31 上午10:33
 * @description
 */
public class ShapeFactory extends AbstractFactory {

    @Override
    public Shape getShape(String shape) {
        if (shape == null || shape.trim().equals("")){
            return null;
        }
        if ("rectangle".equals(shape.toLowerCase())){
            return new Rectangle();
        }else if ("square".equals(shape.toLowerCase())){
            return new Square();
        }else if ("circle".equals(shape.toLowerCase())){
            return new Circle();
        }
        return null;
    }

    @Override
    public Color getColor(String color) {
        return null;
    }
}